/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package lifecare;

/**
 *
 * @author TQNINH
 */
public class Doctor implements Comparable {
    private String name = "";
    private int task = 0;
    
    public Doctor() {
        
    }
    
    public Doctor(String name, int task) {
        this.name = name;
        this.task = task;
    }

    @Override
    public int compareTo(Object t) {
        Doctor doc = (Doctor) t;
        
        int a = 0;
        int b = 0;
        a = this.task;
        b = doc.task;
        
        if(a < b) {
            return -1;
        } else if (a > b) {
            return 1;
        }
        return 0;
    }
    
    public String toString() {
        return "\nThe Doctor is appointed for = " + name +
                "\nThe prority for the appointment is = " + task;
    }
}
